<template>
	<view class="about">
		<uv-navbar title="关于我们" autoBack placeholder bgColor="transparent" />

		<view class="content">
			<image :src="companyInfo.img" mode="widthFix" class="logo" />

			<view class="cell">
				<uv-cell-group :border="false">
					<uv-cell>
						<template #title>
							<uv-text color="#5C5C5C" text="客服电话" size="28rpx" />
						</template>
						<template #value>
							<uv-text color="#5C5C5C" :text="companyInfo.service_tel" size="24rpx" class="uv-text-init" />
						</template>
					</uv-cell>
					<uv-cell>
						<template #title>
							<uv-text color="#5C5C5C" text="所属公司" size="28rpx" />
						</template>
						<template #value>
							<uv-text color="#5C5C5C" :text="companyInfo.company" size="24rpx" class="uv-text-init" />
						</template>
					</uv-cell>
				</uv-cell-group>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive,
		computed,
		onMounted
	} from 'vue';
	import {
		aboutUs
	} from '@/api';
	
	const companyInfo=reactive({
		'company': '',
		'img': '',
		'service_tel': ''
	})

	onMounted(() => {
		aboutUs().then(res => {
				console.log('--------result------', res.result); // 这里获取到 Promise 的解析值
				if(res.code == 200){
					companyInfo.img=res.result.img
					companyInfo.company = res.result.company
					companyInfo.service_tel = res.result.service_tel

				}

			})
			.catch(error => {
				console.error(error); // 处理错误
			});

	});
</script>

<style>
	page {
		background-color: #F6F4F7;
	}
</style>

<style lang="scss" scoped>
	.about {
		height: 100vh;
		background: linear-gradient(to bottom, #EAA8AD, #F6F4F7 50%);

		::v-deep .uv-status-bar {
			background-image: none !important;
			background-color: #EAA8AD !important;
		}

		.content {
			padding-top: 100rpx;
		}

		.logo {
			width: 240rpx;
			margin: 0 auto;
			display: block;
		}

		.cell {
			margin: 30rpx;
			margin-top: 130rpx;
			background-color: #fff;
		}
	}
</style>